/*
 *  $Id: WorldOnFire.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Fire.Spells {
    public class WorldOnFire: SpellCard {
        public WorldOnFire(): base("001_f_s_world_on_fire") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Fire;
            Value = 100;
            AddCondition(new ManaCondition(ElementType.Fire, 1));
        }

        public override void DoAction(TargetArgs args) {
            int x = args.Player.GetMana(ElementType.Fire);
            args.Player.DecrementMana(ElementType.Fire, x);
            DoDamage(args.Player, args.Player, x);
            DoDamage(args.Player, args.Player.Enemy, x);
        }

        private void DoDamage(Player caster, Player player, int damage) {
            player.DamageBy(NewDamage(caster, damage));
            foreach (Creature cr in player.GetCreatures())
                MercilessFire.DoFireDamage(caster, this, cr, damage);
        }
    }
}
